home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
c
/
serus221.zip
/
SERIOUS.DOC
< prev
next >
Wrap
Text File
|
1990-09-01
|
17KB
|
445 lines
page 1
----------- SERIOUS Users Guide -----------
SERIOUS version 2.21 -- serial communications device driver
Copyright (c) 1989,1990 by Norman J. Goldstein
132 Powell Street
Vancouver BC
Canada V6A 1G1
This software is distributed under the Shareware concept.
- You are encouraged to copy and distribute the file SERUS221.ZIP ;
in its original, unmodified form only.
- No fee is to be charged for the software, other than the actual
cost of copying and distribution.
- If you end up using SERIOUS , on other than an evaluation basis,
you are obliged to send in a registration fee to the copyright owner.
The last section of this document has details on this.
The copyright owner is not liable for damages of any kind resulting
from the use of this software.
page 2
Contents
Section Page
1 Introduction 3
2 How SERIOUS works 3
3 Function specifications 4
4 Obtaining the entry address 7
5 The inner workings 8
6 Revisions (future and past) 8
7 Registration 9
page 3
Section 1 -- Introduction
SERIOUS is a device driver for the serial port of the IBM PC and
compatible computers. It is not a communications program. It
does provide the tools to write your own communications program.
There are, of course, BIOS and DOS routines for serial com-
munications, but these are weak, and are not used in serious
programs. The SERIOUS device driver is intended to fill this
gap.
Section 2 -- How SERIOUS works.
The program is a DOS installable device driver. The syntax for its
entry in the config.sys file is
device=serious.sys [name] [ord]
The 2 parameters name and ord are optional, and may be placed
in any order, separated by at least 1 space.
name -- This is the file name by which DOS will recognize the
installed driver. The default name is SERIOUS0 . The 1st
character must not be a digit. Otherwise, the usual DOS
file naming conventions apply; in particular, the name must
be at most 8 characters.
ord -- The driver may be configured to contain a buffer in
which to place incoming characters. The default is that
there be no such buffer. If ord is a number between
1 and 16 , then the driver will contain such a buffer.
Function 0 (open) of section 3 explains how users may
supply their own buffer for the driver to use.
The buffer has length 2 to the power of the order. The
highest allowable order is 16 , which would give the buffer
the size of a complete segment -- 64K bytes. The smallest
allowable order is 1 , creating a meagre 2 byte buffer.
Two advantages to creating and using a default buffer within
the driver are 1) Less work to later open and use the driver,
and 2) The buffer remains in RAM even if the application
program is terminated; this is a convenient way for the driver
to be reaccessed without any incoming characters having been
lost, assuming that the terminated program did not close
the driver.
The disadvantage to creating a default buffer within the
driver is that it may not be deallocated. The driver
code occupies less than 1300 bytes in RAM; having a 2K
buffer would more than double the RAM being used.
The driver contains 5 functions, which may be accessed by the
applications program. They are described in the next section.
page 4
Section 3 -- Function specifications
The functions are accessed by the application filling CPU registers
with appropriate values, and then performing a far call to the
entry address of SERIOUS . The way to obtain the entry address
is explained in section 4 . Examples are in the file serface.c ,
which contains routines for interfacing with Turbo C . These
examples also illustrate how to construct an assembler interface
to SERIOUS . The file serdemo.c is a Turbo C example of an
application using the interface routines of serface.c ; it is a
dumb terminal.
Every function has the following in common.
Input: bx = function number.
Returns bx = error code.
A value of 0 indicates no error.
The file serface.h defines the numeric values of
all the error codes.
------------------------------------------------------------------
Function 0: Open
Purpose: Inform the driver of the user's configuration, and set up
the hardware interrupt routines.
Input: bx = 0 .
ax = base port number of the serial chip.
ch = interrupt request number (IRQ) of the serial chip.
cl = order of the user supplied input buffer.
es = segment of the user supplied input buffer.
di = offset of the user supplied input buffer.
The 'order' and purpose of the input buffer is described in
section 2 . A reasonable order is 10 , for a buffer of 1K .
At 1200 baud, a continuous input stream from the serial port would
fill up a 1K buffer in about 10 seconds. A special case is
entering a value of 0 for the order. This informs the driver to
use the default buffer, which is contained within the driver. The
size of this default buffer is determined at installation as a
command paramater in the config.sys file, as explained in section 2 .
If port is specified as 0 , then this function merely reports
whether the driver is currnetly open. No other input information
is used, in this case.
Return errors: ERR_Active - driver was already open.
ERR_BadOrder - the order is not in the allowable
range of between 1 and 16 , or
neither a default nor a user-defined buffer was
specified.
ERR_BadIrq - The Interrupt Request number is
not between 0 and 15 .
ERR_NotActive - this is possible, if port is
specified as 0 .
------------------------------------------------------------------
page 5
------------------------------------------------------------------
Function 1: SetParms
Purpose: Set the transmission parameters.
Input: bx = 1 .
ax = baud.
ch = stop , cl = data.
dx = parity.
baud = rate of transmission, between 2 and 65,535
bits/second. Some common values are 300 , 1200 and
2400 . The driver has been tested at 9600 , using a
hardwire connection to a